package com.xzzz.irda.guardcat.core.metric.rocketmq;
//
//import lombok.extern.slf4j.Slf4j;
//import org.aspectj.lang.ProceedingJoinPoint;
//import org.aspectj.lang.annotation.Around;
//import org.aspectj.lang.annotation.Aspect;
//import org.springframework.beans.factory.annotation.Autowired;
//
//import javax.annotation.PostConstruct;
//
///**
// * @author xzzz
// */
//@Slf4j
//@Aspect
//public class RocketMQProviderAspect {
//
//    @Autowired(required = false)
//    private RocketMQMetricManager rocketMQMetricManager;
//
//    @Around(value = "execution(public * com.xzzz.mq.client.MqProducer.*(..))")
//    public Object idempotentAround(ProceedingJoinPoint joinPoint) throws Throwable {
//        try {
//            Object[] args = joinPoint.getArgs();
//            if (args != null && args.length >= 1) {
//                String topic = (String) args[1];
//                if (topic.startsWith("topic_") && rocketMQMetricManager != null) {
//                    rocketMQMetricManager.addProducerTopicName(topic);
//                }
//            }
//        } catch (Throwable ignored) {
//        }
//        return joinPoint.proceed(joinPoint.getArgs());
//    }
//}
